package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.NoticeMapper;
import com.example.shoppingmall.pojo.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class NoticeService{
    @Autowired
    NoticeMapper noticeMapper;

    public List<Notice> getNoticeall(String ntitle, String ntime, String nupdtime, String nsort, Integer pageno, Integer pageSize) {
        return noticeMapper.getNoticeall(ntitle, ntime, nupdtime, nsort, pageno, pageSize);
    }

    public int ncount(String ntitle, String ntime) {
        return noticeMapper.ncount(ntitle, ntime);
    }

    public int addNotice(Notice notice){
        return noticeMapper.addNotice(notice);
    }

    public int updNotice(Notice notice){
        return noticeMapper.updNotice(notice);
    }

    public int delNotice(Integer id){
        return noticeMapper.delNotice(id);
    }

    public Notice selnotice(Integer id){
        return noticeMapper.selnotice(id);
    }
}
